<h1><?php echo $this->translate('edit page') ?></h1>
<p><?php echo WSB_Controller_Url::getHtmlLink($this->translate('page:add:linkToOverview'), Cms_Url::containerEditUrl($this->page->id)) ?></p>

<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">

<?php $this->placeholder('page')->captureStart(); ?>

<?php echo $this->translate('page:model:id') ?><br />
<?php echo $this->formText('Page[id]', $this->page->id, array('disable' => true, 'size' => 32)) ?><br />

<?php
// Shortcut
$options = array();
$options = array(
	Cms_Model_Page::SHORTCUT_TYPE_NONE => '',
	Cms_Model_Page::SHORTCUT_TYPE_PAGE => 'Shortcut to page',
	Cms_Model_Page::SHORTCUT_TYPE_FIRST_SUBPAGE  => 'Shortcut to first subpage'
);
?>

<?php echo $this->translate('page:model:shortcut') ?><br />
<?php echo $this->formSelect('Page[shortcut]', $this->page->shortcut, array(), $options); ?><br />

<?php echo $this->translate('page:model:shortcut_page_id') ?><br />
<?php echo $this->formSelectPage('Page[shortcut_page_id]', $this->page->shortcut_page_id); ?><br />

<?php echo $this->translate('page:model:template_id') ?><br />
<?php echo $this->formSelect('Page[template_id]', $this->page->template_id, null, $this->templateOptions); ?><br />

<?php echo $this->translate('page:model:template_not_recursive') ?><br />
<?php echo	$this->formHidden('Page[template_not_recursive]', 0) ?>
<?php echo $this->formCheckbox('Page[template_not_recursive]', 1, array('checked' => (boolean)$this->page->template_not_recursive)) ?><br />

<?php
$languages = '';
$delim = '';
foreach($this->languageVariants AS $lv) {
	$languages .= $delim . $lv->language;
	$delim = ', ';
}
?>

<?php echo $this->translate('page:inherited languages') ?><br />
<?php echo $languages ?><br />

<?php
$strCheckboxes = '';
foreach($this->languages AS $language) {
	$value = 0;
	foreach($this->pageLanguages AS $pageLanguage) {
		if($language->id == $pageLanguage->language_id) {
			$value = 1;
			break;
		}
	}
	$strCheckboxes .= $this->formHidden('PageLanguage[language_id][' . $language->id . ']', 0);
	$strCheckboxes .= $this->formCheckbox('PageLanguage[language_id][' . $language->id . ']', 1, array('checked' => (boolean)$value));
	$strCheckboxes .= $language->language;
}
?>
<?php echo $this->translate('page:languages including subpages') ?><br />
<?php echo $strCheckboxes ?><br />

<?php echo $this->translate('hidden') ?><br />
<?php echo $this->formHidden('Page[hidden]', 0) ?>
<?php echo $this->formCheckbox('Page[hidden]', 1, array('checked' => (boolean)$this->page->hidden)) ?><br />

<?php echo $this->translate('nav_hide') ?><br />
<?php echo $this->formHidden('Page[nav_hide]', 0) ?>
<?php echo $this->formCheckbox('Page[nav_hide]', 1, array('checked' => (boolean)$this->page->nav_hide)) ?><br />

<?php echo $this->translate('page:fegroups') ?><br />
<?php echo $this->formSelectCsvFegroups('Page[fegroups]', $this->page->fegroups) ?><br />

<?php echo $this->translate('page:fegroups_recursive') ?><br />
<?php echo $this->formHidden('Page[fegroups_recursive]', 0) ?>
<?php echo $this->formCheckbox('Page[fegroups_recursive]', 1, array('checked' => (boolean)$this->page->fegroups_recursive)) ?><br />

<?php $this->placeholder('page')->captureEnd(); ?>

<?php $tabs[$this->translate('page common contents')] = $this->placeholder('page'); ?>

<?php

$i = 0;
foreach($this->languageVariants AS $pageLanguage) {
	$this->placeholder('page'.$i)->captureStart();
	if($i == 0) {
		echo $this->translate('page name');
		echo $this->formText('Page[title]', $this->page->title, array('size' => 32));
	} else {
		$name = 'PageOverlay[' . $pageLanguage->id . '][title]';
		$value = '';
		foreach($this->pageOverlays AS $pageOverlay) {
			if($pageLanguage->id == $pageOverlay->language_id) {
				$value = $pageOverlay->title;
				break;
			}
		}
		echo $this->translate('page name');
		echo $this->formText($name, $value, array('size' => 32));
	}
	$this->placeholder('page'.$i)->captureEnd();
	$tabs[$this->languages->getRow($pageLanguage->id)->language] = $this->placeholder('page'.$i);
	$i++;
}
?>

<?php echo $this->jsTab($tabs); ?>

<!-- Buttons -->
<?php echo $this->formSubmit(WSB_BTN_SAVE, $this->translate('button:save'), array('class' => 'button button-save')); ?>
 <?php echo $this->formSubmit(WSB_BTN_SAVE_CLOSE, $this->translate('button:save/close'), array('class' => 'button button-save-close')); ?>

<?php $oncklickHandler = sprintf("javascript:window.location.href='%s';", $this->overviewUrl); ?>
 <?php echo $this->formButton(WSB_BTN_CANCEL, $this->translate('button:cancel'), array('class' => 'button button-cancel', 'onclick' => $oncklickHandler)); ?>

</form>

<!-- http://www.einfach-fuer-alle.de/artikel/formulare/tag1/ -->